$vmName = "DentalDev"
$stop = $FALSE
$path = Get-Location

while(!$stop)
{
	$currentPath = (Get-VMDiskController "DentalDev" -IDE -ControllerID 1 | get-VMDrive | get-VMDisk).connection
	$requestedPath = Get-Content requestedPath.txt
	$requestedPath = Join-Path $path $requestedPath
	Write-Output "Current disk: $currentPath, requested disk: $requestedPath"

	if([string]::Compare($currentPath, $requestedPath, $True))
	{
		write-Output "Changing disks from $currentPath to $requestedPath"
		Remove-VMdrive $vmName 1 0 -IDE 
		Add-VMDisk $vmName 1 0 $requestedPath -DVD
	}

	Start-Sleep -milliseconds 1000
}